@(groupForm: Form[Group])

@import helper._
@import helper.twitterBootstrap._

@main {
    <fieldset>
      <legend>@Messages("grp.form.heading")</legend>
    
      @if(groupForm.hasErrors) {
          <div class="alert-message error">
              <p><strong>Oops</strong> @Messages("msg.err.heading") </p>
              <dl>
                  @for(ferror <- groupForm.errors) {
                      <dt>
                          @Messages("msg.err.fld.lbl") @ferror.key
                      </dt>
                      <dd>@Messages("msg.err.msg.lbl") @ferror.message</dd>
                  }
              </dl>
          </div>
      }

      @form(routes.Groups.submit, 'class -> "form-horizontal") {
          <input type="hidden" name="id" value='@groupForm("id").value' />        
          
              @inputText(groupForm("name"), 'id -> "name", 'size -> 30, '_label -> Messages("grp.name.lbl"))
              @inputText(groupForm("homePage"), 'id -> "homePage", 'size -> 30, '_label -> Messages("grp.home.page.lbl"))
              
          <div class="actions">
              <input type="submit" value='@Messages("save.btn")' class="btn primary"> or 
              <a href="@routes.Groups.list()" class="btn">@Messages("cancel.btn")</a> 
          </div>
          
      }
      
      @if(groupForm("id").value.isDefined) {
        @form(routes.Groups.delete(groupForm("id").value.get.toLong), 'class -> "topRight") {
          <input type="submit" value='@Messages("delete.btn")' class="btn danger">
        }
      }    
      

    </fieldset>
}
